// @ts-ignore
/* eslint-disable */
import request from '@/utils/request.ts'

/** 此处后端没有提供注释 POST /role/addRoleToPermissions */
export async function addRoleToPermissions(
  body: API.RoleAssignPermissionDTO,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseString>('/role/addRoleToPermissions', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 GET /role/allRoles */
export async function selectAllRoles(options?: { [key: string]: any }) {
  return request<API.BaseResponseListSysRole>('/role/allRoles', {
    method: 'GET',
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /role/createRole */
export async function createRole(body: API.SysRole, options?: { [key: string]: any }) {
  return request<API.BaseResponseString>('/role/createRole', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 DELETE /role/deleteRole/${param0} */
export async function deleteRole(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteRoleParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params
  return request<API.BaseResponseString>(`/role/deleteRole/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 GET /role/getPermissions/${param0} */
export async function getRolePermissions(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getRolePermissionsParams,
  options?: { [key: string]: any }
) {
  const { roleId: param0, ...queryParams } = params
  return request<API.BaseResponseListLong>(`/role/getPermissions/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /role/updateRole */
export async function updateRole(body: API.SysRole, options?: { [key: string]: any }) {
  return request<API.BaseResponseString>('/role/updateRole', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}
